<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
  <head>
	<meta charset="utf-8"> 
	<title>Bootstrap 实例</title>
	<!-- 包含头部信息用于适应不同设备 -->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 包含 bootstrap 样式表 -->
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
	
	<style>
	
		teacher-menu a{
			text-decoration:none;
		}
	
		teacher-menu a:link {
			color:#FF0000;
			text-decoration:none;
		}
		teacher-menu a:visited {
			color:#00FF00;
			text-decoration:none;
		}
		teacher-menu a:hover {
			color:#000000;
			text-decoration:none;
		}
		teacher-menu a:active {
			color:#FFFFFF;
			text-decoration:none;
		}
		
		/* .teacher-menu{
			border: 1px solid red;
			width: 10%;
		} */
		
		
		
		/* .level-2:hover{
			
			text-decoration: none;
			text-align: center;
			height: 25px;
			line-height: 25px;
			background-color: lightgray;
			
		} */
	</style>
  </head>

  <body>
	  
	  
	 <!--菜单-->
	 <div class ="teacher-menu">
		 <div id="myCollapsibleExample"><a class="level-1" href="#demo" data-toggle="collapse">老师管理</a></div>
		 <div id="demo" class="collapse">
		 					    <p><a href="#" class="level-2">待审批的请假单</a> </p>
		 						<p><a href="#" class="level-2">已审批的请假单</a></p>
		 
		 	
		   </div>
		   
		   <div id="myCollapsibleExample"><a class="level-1" href="#demo1" data-toggle="collapse">成绩管理</a></div>
		   <div id="demo1" class="collapse">
		   					<p><a href="#" class="level-2">待回复的面试题</a> </p>
		   					<p><a href="#" class="level-2">已回复的面试题</a></p>
		   </div>
	 </div>
	   
	   
	  
	  <!--内容区-->
	  
	  <table class="table table-hover" id="teacher">
		  
		<tr>
			<th>#</th>
			<th>申请人</th>
			<th>请假理由</th>
			<th>开始时间</th>
			<th>结束时间</th>
			<th>操作</th>
		</tr>
		
		<!-- <tr>
			<td>500006</td>
			<td>王伟雄</td>
			<td>家事3</td>
			<td>2021-11-25 14:52:12</td>
			<td>2021-11-25 14:52:15</td>
			<td><button type="button" class="btn btn-primary">同意</button><button type="button" class="btn btn-danger">驳回</button></td>
		</tr> -->
		  
		  
	  </table>
	  
	  
	  
	 
	  
	  <script src="${pageContext.request.contextPath}/js/jquery-2.1.1.min.js"></script>
	  <!-- 可选: 合并了 Bootstrap JavaScript 插件 -->
	  <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
	  
	  <script src="${pageContext.request.contextPath}/js/ajax.js"></script>
	  
	  <script>
	  
			// 待审批请假单？
			
			$(function(){
				
				var url='http://localhost:8080/kaoqin/holiday/findByTeacher.do';
				
				sendGet(url,function(dataR){
					
					var holiday=dataR.data;
					
					var id =holiday.id;
					var name =holiday.name;
					var reason =holiday.reason;
					var beginTime =holiday.beginTime;
					var EndTime =holiday.EndTime;
					
					var tds="<td>"+id+"</td>"
					       +"<td>"+name+"</td>"
						   +"<td>"+reason+"</td>"
						   +"<td>"+beginTime+"</td>"
						   +"<td>"+EndTime+"</td>"
						   +'<td><button type="button" class="btn btn-primary">同意</button><button type="button" class="btn btn-danger">驳回</button>';
						   
					var $tds=$(tds);
					
					var $tr =$("<tr></tr>");
					$tds.appendTo($tr);
					$tr.appendTo($('#teacher'));
					
					
				});
			})
			
	  
	  </script>
  </body>

</html>
